﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.CodeDom;

namespace CodeDomHelper.CodeDom
{

    [Serializable()]
    public class FieldMember : CodeMemberField
    {

        public FieldMember(string propertyName, string type)
            : base(new TypeExp(type), propertyName)
        {
            this.Type = new TypeExp(type);
        }

        public FieldMember (string propertyName, Type type)
            : base(type, propertyName)
        {
            this.Type = new TypeExp(type);
        }

        public FieldMember(string propertyName, TypeExp type)
            : base(type, propertyName)
        {
            this.Type = type;    
            //this.InitExpression
        }


        public FieldMember(string propertyName, string type, CodeExpression initexpression)
            : base()
        {
            this.Type = new TypeExp(type);
            this.InitExpression = initexpression;
        }

        public FieldMember(string propertyName, Type type, CodeExpression initexpression)
            : base()
        {
            this.Type = new TypeExp(type);
            this.InitExpression = initexpression;
        }

        public FieldMember(string propertyName, TypeExp type, CodeExpression initexpression)
            : base()
        {
            this.Type = type;
            this.InitExpression = initexpression;
        }


        public new TypeExp Type { get; set; }

        public CodeObjectCreateExpression New(params CodeExpression[] parameters)
        {
            return Type.New(parameters);
        }   


    }
}
